<!-- 左侧系统菜单 -->
<aside id="system-menu" class="hidden-xs hidden-md">
    <div id="sidebar" class="nav-collapse ">
        <!-- sidebar menu start-->
        <ul class="sidebar-menu" id="nav-accordion">

            <p class="centered">
                <a href="#">
                    <img src="{{asset('system/imgs/ui-sam.jpg')}}" class="img-circle" width="60"></a>
            </p>
            <h5 class="centered">为尔昶盈 ERP系统</h5>

            <?php $left_menu = \App\Utils\MenuUtil::systemMenu();$random_id = 0; ?>

            @foreach($left_menu as $menus)
                <li class="sub-menu">
                    <a data-toggle="collapse" data-target="#left_menu_{{$random_id}}"
                       href="{{$menus['url']}}" class="{{($menu_selected == $menus['title']?"active":"")}}">
                        <span><i class="iconfont {{$menus['icon']}}"></i>{{$menus['title']}}</span>
                    </a>
                    @if(!empty($menus['menus']))
                        {{-- 判断是否展开此列 --}}
                        <?php
                        $temp_in = null;
                        foreach ($menus['menus'] as $item) {
                            if ($item['title'] == $menu_selected) {
                                $temp_in = "collapse";
                                break;
                            }
                        }
                        ?>
                        <ul id="left_menu_{{$random_id}}" class="sub {{$temp_in or "collapse in"}}">
                            @foreach($menus['menus'] as $item)
                                <li>
                                    <a class="{{$menu_selected == $item['title']?"active":""}}"
                                       target="{{isset($item['new'])?"_blank":""}}"
                                       href="{{$item['url']}}"><span>&nbsp;</span>{{$item['title']}}</a>
                                </li>
                            @endforeach
                        </ul>
                    @endif
                </li>
                <?php $random_id++; ?>
            @endforeach
        </ul>
    </div>
</aside>
<!-- 系统菜单结束 -->